package com.recipedb.recipedb.service;

import com.recipedb.recipedb.entity.RecipeDraft;
import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Optional;

public interface RecipeDraftService {

    RecipeDraft save(RecipeDraft entity);

    void deleteById(Long id);

    Optional<RecipeDraft> findById(Long id);

    List<RecipeDraft> findAll();

    List<RecipeDraft> findByUserId(Long userId);

    RecipeDraft updateById(Long id, RecipeDraft partialEntity);

    Page<RecipeDraft> searchDrafts(Long userId, String keyword, String tag, String category, String ingredient,
                                   Integer pageNum, Integer pageSize);

    // 新增：上传封面/步骤图片
    String uploadDraftImage(Long draftId, int stepId, MultipartFile file);

    // 新增：获取封面 URL
    String getCoverUrl(RecipeDraft draft);

    // 新增：获取步骤 URL 列表
    List<String> getStepUrls(RecipeDraft draft);
}
